//
//  HLtreatView.m
//  NewKY
//
//  Created by 罗浩林 on 16/11/14.
//  Copyright © 2016年 Dee. All rights reserved.
//

#import "HLtreatView.h"
#import <SVProgressHUD.h>

@interface HLtreatView ()

@property (nonatomic,assign) BOOL treatSelect;

@end

@implementation HLtreatView

- (IBAction)clickRadioBtn:(id)sender {
    
    if (sender == self.leftRadioBtn) {
        
        if (self.sickSelect == 0 ) {
            
            [SVProgressHUD setMinimumDismissTimeInterval:0.1];
            [SVProgressHUD showErrorWithStatus:@"未选择疾病类型"];
            //            sender.userInteractionEnabled = NO;
            
        }else{
            //            sender.userInteractionEnabled = YES;
            
            
            
            
            self.leftRadioBtn.selected = YES;
            self.rightRadioBtn.selected = NO;
            
            self.treatSelect = YES;
            
            [[NSNotificationCenter defaultCenter] postNotificationName:@"passValue" object:@(self.treatSelect)];
            
            if (self.treatBlock) {
                self.treatBlock();
            }
        }
        
    }
    else{
        
        
        if (self.sickSelect == 0 ) {
            [SVProgressHUD setMinimumDismissTimeInterval:0.1];
            [SVProgressHUD showErrorWithStatus:@"未选择疾病类型"];
            //            sender.userInteractionEnabled = NO;
            
        }else{
            //            sender.userInteractionEnabled = YES;
            
            self.treatSelect = YES;
            
            [[NSNotificationCenter defaultCenter] postNotificationName:@"passValue" object:@(self.treatSelect)];
            
            self.rightRadioBtn.selected = YES;
            self.leftRadioBtn.selected = NO;
            
            if (self.rightBlock) {
                self.rightBlock();
            }
        }
        
    }
    
}


@end
